//
//  JMHomeViewController.m
//  OC-Sina
//
//  Created by 陈高健 on 15/12/22.
//  Copyright © 2015年 陈高健. All rights reserved.
//

#import "JMHomeViewController.h"
#import "JMTitleButton.h"
#import "JMTempOneViewController.h"
#import "JMTempTwoViewController.h"

@interface JMHomeViewController ()

@end

@implementation JMHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    //设置Nav导航控制器左边barButtonItem的样式
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImageName:@"navigationbar_friendsearch" target:self action:@selector(friendsearch)];
    
    //设置Nav导航控制器右边barButtonItem的样式
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithImageName:@"navigationbar_pop" target:self action:@selector(pop)];
    
    //我是首页按钮
    //UIButton *titleButton=[[UIButton alloc]init];
    JMTitleButton *titleButton = [[JMTitleButton alloc]init];
    
    [titleButton setTitle:@"首页" forState:UIControlStateNormal];
    [titleButton setImage:[UIImage imageNamed:@"navigationbar_arrow_down"] forState:UIControlStateNormal];
    //titleButton.backgroundColor = [UIColor redColor];
    
    [titleButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [titleButton sizeToFit];
    //titleButton.size = titleButton.currentImage.size;
    
    //设置Nav中心,我的首页
    self.navigationItem.titleView =titleButton;
    
}

//点击方法friendsearch
- (void)friendsearch{
    NSLog(@"左边");
    //设置第一个控制器
    JMTempOneViewController *oneViewController = [[JMTempOneViewController alloc]init];
    [self.navigationController pushViewController:oneViewController animated:YES];
    
}

//点击方法pop
- (void)pop{
    NSLog(@"右边");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
